<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Repositories\AreaRepo;
class AreaController extends BaseController
{
	public function all()
	{
		$areaRepo = new AreaRepo();

		$data = $areaRepo->getAll();

		return $this->sucRes(200,$data);
	}
	public function index()
	{
		$areaRepo = new AreaRepo();

		$data = $areaRepo->getAreaList();

		return $this->sucRes(200,$data);
	}
	public function create(Request $request)
	{
		$areaRepo = new AreaRepo();

		$data = $areaRepo->getAll();

		return $this->sucRes(200,$data);
	}
	public function update(Request $request)
	{
		$areaRepo = new AreaRepo();

		$data = $areaRepo->getAll();

		return $this->sucRes(200,$data);
	}
	public function del(Request $request)
	{
		$areaRepo = new AreaRepo();

		$data = $areaRepo->getAll();

		return $this->sucRes(200,$data);
	}


	public function updateProduct(Request $request)
	{
		$product_id = $request->product_id;
		$area_id    = $request->area_id;
		$areaRepo = new AreaRepo();
		$areaRepo->setProductArea($product_id,$area_id);
		return $this->sucRes();
	}

}